package com.jkl.entity;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.jkl.pojo.Account;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 返回一个登录后的信息
 * status 登录状态
 * userName 用户的名字
 * sign 用户的标签
 * alterTime 用户的最后修改日期
 * serverAddr 用户客户端连接netty服务器地址
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL)

public class RAppLoginForm{
    public int status;
    public String serverAddr;
    public String userName;
    public String sign;
    public Long alterTime;
    public String token;
    public RAppLoginForm(int status, String serverAddr, Account account, String token){
        this.status=status;
        this.serverAddr=serverAddr;
        this.userName= account.getUserName();
        this.sign=account.getSign();
        this.alterTime=account.getAlterTime();
        this.token=token;
    }
    public RAppLoginForm(int status,String serverAddr,String token){
        this.status=status;
        this.serverAddr=serverAddr;
        this.token=token;
    }
    public RAppLoginForm(int status) {
        this.status=status;
    }
}
